PACKAGE=$1
if [ "$PACKAGE" = "" ]; then
    echo 'Please specify package!'
    exit
fi

VERSION=$2
if [ "$VERSION" = "" ]; then
    echo 'Please specify version!'
    exit
fi

echo Making $PACKAGE version $VERSION
echo
mkdir tmp || exit
cp -r $PACKAGE tmp/
cd tmp
find $PACKAGE/ -name '*.pyc' -o -name '*~' -o -name '.svn' -o -name 'rendertext-cache' | xargs rm -rf
rm ../$PACKAGE-$VERSION.zip
zip -r ../$PACKAGE-$VERSION.zip $PACKAGE
rm ../$PACKAGE-$VERSION.tar.gz
tar cvfz ../$PACKAGE-$VERSION.tar.gz $PACKAGE
cd ..
rm -rf tmp
